import 'package:bruno/bruno.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../AppConfig/Config.dart';

class FreezeAmount extends StatefulWidget {
  const FreezeAmount({super.key});

  @override
  State<FreezeAmount> createState() => _FreezeAmountState();
}

class _FreezeAmountState extends State<FreezeAmount> {
  Future _onRefresh() async {

  }
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
        backgroundColor: MyColors.backgreyColor,
        appBar: AppBar(

        title:Text( "冻结金额",style: TextStyle(fontWeight: FontWeight.w300,fontSize: 16.sp),),
          backgroundColor: Colors.white,
          centerTitle: true,
          leading: IconButton(
          icon: Icon(Icons.arrow_back_ios, color: Colors.black),
          onPressed: () => Navigator.of(context).pop(),
          ),
        ),
      body: ListView(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              TextButton(onPressed: (){
                showDialog(
                  barrierDismissible: false,
                  context: context,
                  builder: (BuildContext context) {
                    return BrnDialog(
                      titleText: "什么是冻结资金",
                      messageText:"指您有部分资金额度不能使用，一般是因为一些特殊业务或账户出现问题时会发生。需要联系客服解冻后，该部分资金才能够正常使用。",
                      actionsWidget: [
                        TextButton(
                          onPressed: () {
                            Navigator.pop(context);
                          },
                          child: Text("知道了",style: TextStyle(color: MyColors.themeColor,fontSize: 14.sp),),
                        ),
                      ],
                    );
                  },
                );
              }, child: Text("什么是冻结资金？",style: TextStyle(color: MyColors.themeColor,fontSize: 14.sp),)),
            ],
          ),
      EasyRefresh(
        header:
        ClassicHeader(
          dragText: '下拉刷新',
          armedText: '准备释放',
          readyText: '加载中...',
          processingText: '加载中...',
          processedText: '刷新成功',
          noMoreText: '暂无更多',
          failedText: '刷新失败',
          messageText: '刷新时间 %T',
        ),
        footer: ClassicFooter(
          dragText: '加载更多',
          armedText: '准备释放',
          readyText: '加载中...',
          processingText: '加载中...',
          processedText: '加载成功',
          noMoreText: '暂无更多',
          failedText: '加载失败',
          messageText: '加载时间 %T',
        ),
        onRefresh: _onRefresh,
        // onLoad:dataList.length>pageNum*20-1?onReachBottom:null,
        child:
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w),
            height: screenSize.height-40.h,
            child:ListView.builder(

                itemCount: 3,
                itemBuilder: (BuildContext context, int index) {
                  return Container(
                    margin: EdgeInsets.only(bottom: 8.h),
                    padding: EdgeInsets.only(left: 10.w,top: 10.h,bottom: 10.h,right: 10.w),
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.all(Radius.circular(10)),
                      color: Colors.white,
                    ),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text("张老板",style: TextStyle(color: Colors.black,fontWeight: FontWeight.w600,fontSize: 13.sp),),
                            Row(
                              children: [
                                Text("¥"+"20.00",style: TextStyle(color: MyColors.themeColor,fontWeight: FontWeight.w600,fontSize: 14.sp),),

                                SizedBox(width: 4.w,),
                                BrnTagCustom.buildBorderTag(
                                  tagText: '异常运单',
                                  textColor: Colors.red,
                                  borderColor: Colors.red,
                                  borderWidth: 1,
                                  backgroundColor:Color.fromRGBO(251, 236, 228, 1),
                                  fontSize: 11.sp,
                                ),
                                SizedBox(width: 8.w,),
                              ],
                            ),

                          ],
                        ),
                        SizedBox(height: 4.h,),
                        Text("支付时间"+" "+"2024-05-06",style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                        SizedBox(height: 4.h,),
                        Text("苏州市"+" "+"吴中区"+" "+"——"+" "+"苏州市 吴中区",style: TextStyle(color: Colors.black,fontSize: 12.sp),),
                        // Row(
                        //   mainAxisAlignment: MainAxisAlignment.end,
                        //   children: [ BrnTagCustom(
                        //     tagText: '货主已退还',
                        //     textColor: Colors.black,
                        //     fontSize: 12.sp,
                        //     textPadding: EdgeInsets.all(6),
                        //     backgroundColor:Color.fromRGBO(251, 236, 228, 0.45),
                        //     tagBorderRadius: BorderRadius.only(bottomRight: Radius.circular(10)),
                        //   ),
                        //   ],
                        // ),
                      ],
                    ),
                  );
                }),
          ),
      )
        ],
      ),
    );
  }
}
